# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=libieee1284
pkgver=0.2.11
pkgrel=2
pkgdesc="A cross-platform library for parallel port access"
url="http://cyberelk.net/tim/libieee1284"
arch="all"
license="GPL-2.0-or-later"
makedepends="file"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/sourceforge/libieee1284/libieee1284-$pkgver.tar.bz2
	include.patch"

prepare() {
	default_prepare
	update_config_guess
	update_config_sub
}

build() {
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--without-python \
		ac_cv_header_sys_io_h=no
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

dev() {
	default_dev
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}

static() {
	depends=""
	pkgdesc="$pkgdesc (static library)"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib
}
sha512sums="06cc3049ce15613d34e39dc71bc572843c61ab64077c29ef9a6257edb0849c98565ff612a4cf787bc9642a39f1c89b7c47a20fb27f2318105be82aad8d472bb9  libieee1284-0.2.11.tar.bz2
dccf1a78c02c6c1ea25eb3e054327298aac11972a32fafaa2180db31441f69cc1528bcb73127b7721776e946edee2344273d77443146bd707535bad148209453  include.patch"
